﻿<Window x:Class="Tagomatique.View.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        
        xmlns:conv="clr-namespace:Tagomatique.View.Converters"
        xmlns:Ressources="clr-namespace:Tagomatique.Resources;assembly=Tagomatique.Resources"
        xmlns:Controls="clr-namespace:Tagomatique.View.Controls"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:view="clr-namespace:Tagomatique.View" mc:Ignorable="d"

        Title="MainWindow"
        WindowStartupLocation="CenterScreen"
        WindowStyle="SingleBorderWindow"
        Height="600" Width="1000" d:DataContext="{d:DesignInstance view:MainWindowContext}">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources\ListStyle.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <!-- Barre de menu -->
            <RowDefinition Height="26" />

            <!-- Zone principale -->
            <RowDefinition Height="*" />

            <!-- Barre d'état/information -->
            <RowDefinition Height="26" />
        </Grid.RowDefinitions>

        <Grid.Resources>
            <conv:BitmapConverter x:Key="convBitmap" />
        </Grid.Resources>

        <!-- Barre de menu -->
        <StackPanel Grid.Row="0" Margin="3" FlowDirection="RightToLeft">
            <Button Height="20" Width="20" HorizontalAlignment="Left" Command="{Binding ShowSearchWindowCommand}">
                <Button.Template>
                    <ControlTemplate>
                        <Image Source="{Binding Source=Open, Converter={StaticResource convBitmap}}" />
                    </ControlTemplate>
                </Button.Template>
            </Button>
        </StackPanel>

        <!-- Zone principale -->
        <DockPanel Grid.Row="1">
            <!-- Selection des Tags -->
            <Grid DockPanel.Dock="Left" MinWidth="200">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" MinHeight="20" />
                </Grid.RowDefinitions>

                <TextBlock Grid.Row="0" Text="{x:Static Ressources:Messages.TagsDisponibles}" />
                <ListBox Name="lstTagDisponible"
                 Grid.Row="1"
                 Style="{StaticResource GroupedTagListBoxStyle}"
                 ItemsSource="{Binding GroupedTagDisponibles, Mode=OneWay}" />

                <TextBlock Grid.Row="2" Text="{x:Static Ressources:Messages.TagsSelectionner}" />
                <ListBox Name="lstTagSelectionner"
                 Grid.Row="3"
                 Style="{StaticResource GroupedTagListBoxStyle}"
                 ItemsSource="{Binding GroupedTagSelectionner, Mode=OneWay}" />
            </Grid>
            
            <Controls:DockPanelSplitter DockPanel.Dock="Left" />

            <!-- Media selectionner -->
            <Grid DockPanel.Dock="Right" MinWidth="300">
                <Border BorderThickness="1" BorderBrush="LightGreen">
                    <Image Source="{Binding CurrentMediaCorrespondant.Thumbnail}" MaxWidth="800" Stretch="Uniform" />
                </Border>
                <TextBlock Text="{Binding CurrentMediaCorrespondant.AbsoluteURL}" />
            </Grid>

            <Controls:DockPanelSplitter DockPanel.Dock="Right" />

            <!-- Liste des Media Correspondant -->
            <Grid>
                <ListBox Name="lstMediaCorrespondant" MinWidth="200"
                 Style="{StaticResource MediaListBoxStyle}"
                 ItemsSource="{Binding MediaCorrespondant, Mode=OneWay}" IsSynchronizedWithCurrentItem="True" />
            </Grid>
        </DockPanel>

        <!-- Barre d'état/information -->
        <TextBlock Grid.Row="2" Text="{x:Static Ressources:Erreurs.DataModeNonSupporter}" />
    </Grid>
</Window>
